package com.yihu.wlyy.web.common.advert;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yihu.wlyy.service.common.advert.AdvertService;
import com.yihu.wlyy.web.BaseController;

@Controller
@RequestMapping(value = "common")
//@Api(description = "广告查询")
public class AdvertController extends BaseController {
	
	@Autowired
	private AdvertService advertService;


	@RequestMapping(value = "advert")
	@ResponseBody
	public String list(int type) {
		try {
			return write(200, "查询成功", "list" , advertService.findByType(type));
		} catch (Exception e) {
			error(e);
			return error(-1, "查询失败");
		}
	}
}
